package com.puppet.building182.handler.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionController {
    @ExceptionHandler(MyBuildingException.class)
    public ResponseEntity<?> handleException(MyBuildingException e) {
        System.out.println("全局异常拦截异常信息");
        return ResponseEntity.status(e.getResult().getCode()).body(e.getResult());
    }


}
